/*************************************************************************
	> File Name: 007.折半查找-函数.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 三  8/25 11:33:19 2021
 ************************************************************************/

#include <stdio.h>

//数组是展开了的函数，函数是压缩了的数组

int func(int x) {
    return x * x;
}

int binary_search(int (*arr)(int), int x, int n) { //传入函数指针
    int head = 0, tail = n - 1, mid;
    while (head <= tail) {
        mid = (head + tail) >> 1;
        if (arr(mid) == x) return mid;
        if (arr(mid) < x) head = mid + 1;
        else tail = mid - 1;
    }
    return -1;
}

int main() {
    int n;
    while (~scanf("%d", &n)) {
        int x = binary_search(func, n, n);
        printf("%d * %d = %d\n", x, x, n);
    }
    return 0;
}
